<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
    <head>
        <title>Hambre de Sushi</title>
        <meta name="layout" content="sushiheader" />
        <style type="text/css" media="screen">
        #mainpage
        {
            margin:20px 40px;
            border: 1px green solid;
            padding: 20px;
            background-color: #d9ffa7;
        }
        #week td
        {
            text-align: center;
            width: 12%;
            border: 1px solid green;
        }
        #mainpage table
        {
            border: none;
            width: 90%;
            border-collapse: collapse;
            border: 1px solid green;

        }
        #week tr
        {
            background-color: white;
            width: auto;
        }

        .colored
        {
            background-color: #c6ff7c;
        }

        .discountEvent
        {
            padding: 5px;
            background-color: #f69322;
            color: white;
            margin: 2px 0px;
        }

        .discountEvent h3
        {
            margin: 3px 0px;
            font-size: 14px;

        }
        .discountEvent:hover
        {
            background-color: #ffaf54;
        }
        #week a:link, #week a:visited, #week a:hover
        {
            font-weight: normal;

        }

        .discountEvent2
        {
            padding: 5px;
            background-color: #cb2600;
            color: white;
            margin: 2px 0px;
        }

        .discountEvent2 h3
        {
            margin: 3px 0px;
            font-size: 14px;

        }
        .discountEvent2:hover
        {
            background-color: #e74924;
        }

}
        
        </style>
    </head>
    <body>
        <div id="mainpage">
            <h3>Bienvenido a <em>Hambre de Sushi</em></h3>
            <br/>
            <p>¿Has intentado salir a comer sushi a un local bueno y barato? <br/>
            Habiendo tantas promociones y descuentos disponibles es fácil confundirse. <em>Hambre de Sushi</em> te ayudará a encontrar
            todo tipo de descuentos en locales de sushi, y también cómo y cuándo aplican.</p>
            <br/>
            <br/>

            <table id="week">
                <tr>
                    <td>Lunes</td>
                    <td class="colored">Martes</td>
                    <td>Miércoles</td>
                    <td class="colored">Jueves</td>
                    <td>Viernes</td>
                    <td class="colored">Sábado</td>
                    <td>Domingo</td>
                </tr>
                <tr>
                    <td>
                         <g:each in="${MondayList}" status="i" var="discountInstance">
                           <g:link action="show" controller ="discount"  id="${discountInstance.id}">
                             <g:if test="${discountInstance.greaterThan()}">
                               <div class="discountEvent2">
                             </g:if>
                             <g:else>
                               <div class="discountEvent">
                             </g:else>
                                 <h3>${fieldValue(bean: discountInstance, field: "percentage")}&#37</h3>
                                 
                                 <p>${fieldValue(bean: discountInstance, field: "sushiplace.name")}</p>
                               </div>
                           </g:link>
                        </g:each>
                    </td>
                    <td>
                        <g:each in="${TuesdayList}" status="i" var="discountInstance">
                           <g:link action="show" controller ="discount"  id="${discountInstance.id}">
                             <g:if test="${discountInstance.greaterThan()}">
                               <div class="discountEvent2">
                             </g:if>
                             <g:else>
                               <div class="discountEvent">
                             </g:else>
                               <h3>${fieldValue(bean: discountInstance, field: "percentage")}&#37</h3>
                               
                               <p>${fieldValue(bean: discountInstance, field: "sushiplace.name")}</p>
                             </div>
                           </g:link>
                        </g:each>
                    </td>
                    <td>
                        <g:each in="${WednesdayList}" status="i" var="discountInstance">
                           <g:link action="show" controller ="discount"  id="${discountInstance.id}">
                             <g:if test="${discountInstance.greaterThan()}">
                               <div class="discountEvent2">
                             </g:if>
                             <g:else>
                               <div class="discountEvent">
                             </g:else>
                               <h3>${fieldValue(bean: discountInstance, field: "percentage")}&#37</h3>
                               
                               <p>${fieldValue(bean: discountInstance, field: "sushiplace.name")}</p>
                             </div>
                           </g:link>
                        </g:each>
                    </td>
                    <td>
                       <g:each in="${ThursdayList}" status="i" var="discountInstance">
                          <g:link action="show" controller ="discount"  id="${discountInstance.id}">
                             <g:if test="${discountInstance.greaterThan()}">
                               <div class="discountEvent2">
                             </g:if>
                             <g:else>
                               <div class="discountEvent">
                             </g:else>
                               <h3>${fieldValue(bean: discountInstance, field: "percentage")}&#37</h3>
                               
                               <p>${fieldValue(bean: discountInstance, field: "sushiplace.name")}</p>
                             </div>
                          </g:link>
                        </g:each>
                    </td>
                    <td>
                      <g:each in="${FridayList}" status="i" var="discountInstance">
                          <g:link action="show" controller ="discount"  id="${discountInstance.id}">
                             <g:if test="${discountInstance.greaterThan()}">
                               <div class="discountEvent2">
                             </g:if>
                             <g:else>
                               <div class="discountEvent">
                             </g:else>
                               <h3>${fieldValue(bean: discountInstance, field: "percentage")}&#37</h3>
                               
                               <p>${fieldValue(bean: discountInstance, field: "sushiplace.name")}</p>
                             </div>
                          </g:link>
                        </g:each>
                    </td>
                    <td>
                       <g:each in="${SaturdayList}" status="i" var="discountInstance">
                           <g:link action="show" controller ="discount" id="${discountInstance.id}">
                             <g:if test="${discountInstance.greaterThan()}">
                               <div class="discountEvent2">
                             </g:if>
                             <g:else>
                               <div class="discountEvent">
                             </g:else>
                               <h3>${fieldValue(bean: discountInstance, field: "percentage")}&#37</h3>
                               
                               <p>${fieldValue(bean: discountInstance, field: "sushiplace.name")}</p>
                             </div>
                           </g:link>
                        </g:each>
                    </td>
                    <td>
                       <g:each in="${SundayList}" status="i" var="discountInstance">
                           <g:link action="show" controller ="discount" id="${discountInstance.id}">
                             <g:if test="${discountInstance.greaterThan()}">
                               <div class="discountEvent2">
                             </g:if>
                             <g:else>
                               <div class="discountEvent">
                             </g:else>
                               <h3>${fieldValue(bean: discountInstance, field: "percentage")}&#37</h3>
                               
                               <p>${fieldValue(bean: discountInstance, field: "sushiplace.name")}</p>
                             </div>
                           </g:link>
                        </g:each>
                    </td>
                </tr>
                    
            </table>

        </div>
      
        <g:render template="/footer" />
        <style type="text/css" media="screen">
            #footer
            {
                background-image: url(images/skin/light.png);
                background-repeat: repeat-x;
            }
        </style>

    </body>
</html>

